package de.hauschild.orbitvm.vm;

/**
 * A point with components represented by {@link Double}.
 * 
 * @since 1.0.0
 * @author Klaus Hauschild
 */
public class DoublePoint {

  private final Double x;
  private final Double y;
  private final Double length;

  /**
   * Instantiates a new double point.
   * 
   * @param theX
   *          the x
   * @param theY
   *          the y
   */
  public DoublePoint(final Double theX, final Double theY) {
    x = theX;
    y = theY;
    length = Math.sqrt(x * x + y * y);
  }

  /**
   * Gets the x.
   * 
   * @return the x
   */
  public Double getX() {
    return x;
  }

  /**
   * Gets the y.
   * 
   * @return the y
   */
  public Double getY() {
    return y;
  }

  /**
   * Length.
   * 
   * @return the double
   */
  public Double length() {
    return length;
  }
}
